package com.net.oil.push.presenter;

import com.net.oil.base.BasePresenter;
import com.net.oil.push.bean.NewsDetailBean;
import com.net.oil.push.bean.TechnologySupportDetail;
import com.net.oil.push.contract.PushHandleContract;
import com.net.oil.push.model.PushHandleModel;

/**
 * 作者：lch
 * 时间：2018/4/22 0022:下午 16:46
 * 邮箱：245850413@qq.com
 * 说明：
 */

public class PushHandlePresenter extends BasePresenter<PushHandleContract.View> implements PushHandleContract.Presenter {

    private PushHandleContract.View view;
    private PushHandleContract.Model model;

    public PushHandlePresenter(PushHandleContract.View view) {
        this.view = view;
        model = new PushHandleModel(this);
    }

    @Override
    protected void unSubscribe() {
        model.unSubscribe();
    }

    @Override
    public void getTechnologySupportDetail(int id) {
        model.getTechnologySupportDetail(id);
    }

    @Override
    public void getTechnologySupportDetailSuccess(TechnologySupportDetail detail) {
        view.getTechnologySupportDetailSuccess(detail);
    }

    @Override
    public void getTechnologySupportDetailFailed() {
        view.getTechnologySupportDetailFailed();
    }

    @Override
    public void getNewsDetail(int id) {
        model.getNewsDetail(id);
    }

    @Override
    public void getNewsDetailSuccess(NewsDetailBean newsDetailBean) {
        view.getNewsDetailSuccess(newsDetailBean);
    }

    @Override
    public void getNewsDetailFailed() {
        view.getNewsDetailFailed();
    }
}
